<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取经纬度</title>
    <!-- 1、引入资源 -->
    <script type="text/javascript">
        window._AMapSecurityConfig = {
          securityJsCode:"ec8990c1cac6e2f42866a4f908a19989",
        }
      </script>
      <script type="text/javascript"
      src="https://webapi.amap.com/maps?v=2.0&key=1d8c4c24f36ffedf82812d42f9835ac9"></script>
    <!-- 3、形容容器 -->
    <style>
        body,html,#container
        {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <!-- 2、创建容器 -->
    <div id="container"></div>
    <!-- 4、使用地图 -->
<!-- 5、监听地图点击事件 -->
    <script>
        var map=new AMap.Map('container',{
        center:[116,30],
        zoom:10,
        viewMode:'3D',
        pitch:45
        })


        map.on('click',function(e){
            console.log(`经度: ${e.lnglat.lng},纬度: ${e.lnglat.lat}`);

        })

    </script>
</body>
</html>